package com.zzty.springmybatis.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zzty.springmybatis.DAO.QuestionDAO;
import com.zzty.springmybatis.entity.Question;
import com.zzty.springmybatis.service.QuestionService;


/*@Service("userService")
*/
@Service
public class QuestionServiceImpl implements QuestionService {
	@Autowired
	private QuestionDAO questionDAO;

	@Override
	public List<Question> selectAll(Integer Num1,Integer Num2) {
		return this.questionDAO.selectAll( Num1,  Num2);
	}

	@Override
	public Integer count() {
		return this.questionDAO.count();
	}

	@Override
	public int insertQue(String content) {
		return this.questionDAO.insertQue(content);
	}

	@Override
	public Integer selectQueId(String content) {
		return this.questionDAO.selectQueId(content);
	}

	@Override
	public Question selectQuecontent(String id) {
		return this.questionDAO.selectQuecontent(id);
	}

	@Override
	public  String  Questionbyid(String[] array) {
		String questions = "";
		for (int i = 0; i < array.length; i++) {
			questions = questions + (i + 1) + "." + this.questionDAO.selectQuecontent(array[i]).getContent() + "\r\n";
		}
		return questions;
	}

	@Override
	public Integer searchNewId(String date, String questions, Integer clazzId) {
		return this.questionDAO.searchNewId(date, questions, clazzId);
	}

	
	@Override
	public Integer searchNewId1(String date, String questions, Integer clazzId) {
		return this.questionDAO.searchNewId1(date, questions, clazzId);
	}

	@Override
	public List<Integer> selectStuId(Integer clazzId,Integer type) {
		return this.questionDAO.selectStuId(clazzId,type);
	}

	@Override
	public Integer insertselfexamtransation(Integer examId, Integer userId) {
		return this.questionDAO.insertselfexamtransation(examId, userId);
	}

	@Override
	public List<String> selectstu_ids(Integer id,Integer class_id) {
		return this.questionDAO.selectstu_ids(id, class_id);
	}

	@Override
	public Integer selectLastSelfId(Integer clazzId) {
		return this.questionDAO.selectLastSelfId( clazzId);
	}

	@Override
	public Integer selectLastTeamId(Integer clazzId) {
		return this.questionDAO.selectLastTeamId( clazzId);
	}

	@Override
	public Integer LastSelfId(Integer clazzId) {
		return this.questionDAO.LastSelfId( clazzId);
	}
	


}
